'''
Created on 5/01/2013

@author: Jorge
'''
from VectorizedClaim import Example
class SVMTreeExample(Example):
    
    upper_labels = []
    
    def __init__(self, X, y):
        super(SVMTreeExample, self).__init__(X,y)
        self.upper_y = None
    
    def set_upper_y(self, y):
        self.upper_y = y
        
        if self.upper_y not in SVMTreeExample.upper_labels:
            SVMTreeExample.upper_labels.append(self.upper_y)
            
    def get_numerical_upper_y(self):
        return SVMTreeExample.get_number_upper_label(self.upper_y)
        
        
    def get_upper_y(self):
        return self.upper_y
    
    @staticmethod
    def get_number_upper_label(label):
        return SVMTreeExample.upper_labels.index(label)